home *** CD-ROM | disk | FTP | other *** search
/ Archive Magazine CD 1995 / Archive Magazine CD 1995.iso / discs / prog_disc / volume_7 / issue_12 / hints / SetColourN (.txt) < prev   
Encoding:
RISC OS BBC BASIC V Source  |  1994-07-22  |  2.1 KB  |  106 lines

  1.  >ColTest
  2. " at line ";
  3.  "Press 
  4.  for multisync or 
  5.  for standard"
  6.  "resolution monitors."
  7.       A=
  8.   77 : msync%=
  9.                ok%=
  10.   83 : msync%=
  11.                ok%=
  12.  109 : msync%=
  13.                ok%=
  14.  115 : msync%=
  15.                ok%=
  16.  : ok%=
  17.  msync% 
  18.  C%=0 
  19.       
  20.  0 : 
  21.       
  22.  1 : 
  23.       
  24.  2 : 
  25. fourcoldt
  26.       
  27.  3 : 
  28. "      
  29.  4 : 
  30. sixteencoldt
  31.       
  32.  5 : 
  33.         
  34.         
  35.  x%=0 
  36.       
  37.  y%=0 
  38. !!        
  39. setcolour(x%,y%,0,0)
  40. "'        
  41.  69,(x%<<1)+224,(y%<<1)+96
  42.       
  43. $        
  44.     A=
  45.  C%=0 
  46.       
  47.  0 : 
  48.       
  49.  1 : 
  50.       
  51.  2 : 
  52. fourcoldt
  53.       
  54.  3 : 
  55. .!      
  56.  4 : 
  57. sixteencoldt
  58.       
  59.  5 : 
  60. 0        
  61. 1        
  62.  x%=0 
  63.       
  64.  y%=0 
  65. 4!        
  66. setcolour(x%,y%,0,0)
  67. 5         
  68.  69,(x%<<2),(y%<<2)
  69.       
  70. 7        
  71.     A=
  72.  Set up the desktop palette for the appropriate colours
  73.  (4 & 16 colours only)
  74. fourcoldt
  75. 19,0,16,255,255,255
  76. 19,1,16,170,170,170
  77. 19,2,16, 85, 85, 85
  78. 19,3,16,  0,  0,  0
  79. sixteencoldt
  80. 19, 0,16,255,255,255
  81. 19, 1,16,221,221,221
  82. 19, 2,16,187,187,187
  83. 19, 3,16,153,153,153
  84. 19, 4,16,119,119,119
  85. 19, 5,16, 85, 85, 85
  86. 19, 6,16, 51, 51, 51
  87. 19, 7,16,  0,  0,  0
  88. 19, 8,16,  0, 68,153
  89. 19, 9,16,238,238,  0
  90. 19,10,16,  0,204,  0
  91. 19,11,16,221,  0,  0
  92. 19,12,16,238,238,187
  93. 19,13,16, 85,136,  0
  94. 19,14,16,255,187,  0
  95. 19,15,16,  0,187,255
  96.  PROCsetcolour
  97.  r%, g%, b% set the amounts of red green and blue for the desired
  98.  colour, Colourtrans will be used to pick the closest colour
  99.  and set it.  effect is a standard GCOL effect field
  100.  Use SWI number for speed :
  101.  ColourTrans_SetGCOL = &40743
  102. setcolour(r%,g%,b%,effect%)
  103.  colour%
  104. a%colour%=(b%<<24)+(g%<<16)+(r%<<8)
  105.  &40743,colour%,,,0,effect%
  106.